package com.zengshuai.miniprogrambackend.Mapper;

import com.zengshuai.miniprogrambackend.Entity.Part;
import com.zengshuai.miniprogrambackend.Entity.Service;
import com.zengshuai.miniprogrambackend.Entity.ServiceSwiper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ServiceMapper {

    List<Service> getservicelistbycategory(@Param("category") int category);

    Service getservicebyserviceid(@Param("serviceid") int serviceid);

    ServiceSwiper getServiceSwiper(@Param("serviceid") int serviceid);


    //后台管理部分

    List<Service> getservicelist(Integer page, Integer pagesize);

    //查询服务
    List<Service> cxServiceListByServiceName(Integer page, Integer pagesize, String servicename);


    int updateService(String servicename, String servicecategory, String serviceprice, String description, String serviceintroduction, String serviceid);

    int servicenameisExisted(String servicename);

    void addService(String servicename, String servicecategory, String serviceprice, String description, String serviceintroduction);


    Integer getservicelistlength();

    //保存上传图片的访问地址
    void saveImageurl(String imageurl, String servicename);

    //后台上传的轮播图图片保存
    void saveImageurl2(String imageurl, String serviceid,String column);


    List<Part> getPartslistByLimit(Integer page, Integer pagesize);

    Integer getpartslistlength();

    int partisExisted(String partname);

    //  添加配件
    void addpart(String serviceid, String partname, String partprice, String category, String desc, String brand);

    List<Part> cxparts(Integer page, Integer pagesize, String partname);

    void deletePart(String serviceid);

    int updatepart(String serviceid, String partname, String partprice, String category, String desc, String brand, String id);



    Service search(String keyword);
}